<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/new-thread.css" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<link type="text/css" rel="stylesheet" href="css/menu.css" />
<link type="text/css" rel="stylesheet" href="css/footer.css" />
<title>Chỉnh sửa bài viết</title>
<style type='text/css'>
.text {
	margin-top: 5px;
}
</style>
</head>
<body>
	<%@ include file="Header.jsp"%>

	<c:set var="url">
		<c:choose>
			<c:when test="${param.type=='thread'}">tid=${obj.id}</c:when>
			<c:otherwise>tid=${obj.threadId}&cid=${obj.id}</c:otherwise>
		</c:choose>
	</c:set>
	<div id="wrapper">
		<form action="thread?do=save&type=${param.type}&${url}" method="post">
			<c:if test="${param.type=='thread'}">
				<input type="text" name="title" value="${obj.title}"
					style='margin-bottom: 5px' />
			</c:if>
			<textarea name="content">${obj.content}</textarea>
			<button type='submit' name='save' class='button'>Lưu</button>
			<button type='button' name='quit' class='button'
				onclick="window.location='thread?do=view&${url}'">Hủy bỏ</button>
		</form>
	</div>

	<jsp:include page="Footer.jsp"></jsp:include>
</body>
</html>